{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6a1d3564",
   "metadata": {},
   "source": [
    "----------------\n",
    "* 记录人：纪秋霞\n",
    "* 时间：2021-11-18\n",
    "* week12\n",
    "* 主要参考文档：\n",
    "> python官方 \n",
    "\n",
    "> gitee\n",
    "-----------------"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c0f7bbcc",
   "metadata": {},
   "source": [
    "# 本周内容\n",
    "## 1. 字典的实践 （一）\n",
    "\n",
    "* 课本p112-p113\n",
    "* 知识点：\n",
    "> 1. 利用字典计算词频\n",
    "> 2. 字典的初始化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "019a3986",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入一段文本，将统计元音字母出现的次数:hello\n",
      "{'a': 0, 'e': 1, 'i': 0, 'o': 1, 'u': 0}\n"
     ]
    }
   ],
   "source": [
    "# 在列表的基础上（列表可统计出现的内容有哪些）\n",
    "# 字典可统计出现的内容 + 出现的次数（词频）\n",
    "\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]       # iterable\n",
    "word = input(\"请输入一段文本，将统计元音字母出现的次数:\")\n",
    "found = {}\n",
    "\n",
    "# 利用字典创建的方式，创建字典—— dict_name[key]=value\n",
    "# 方法一\n",
    "# found[\"a\"]=0\n",
    "# found[\"e\"]=0\n",
    "# found[\"i\"]=0\n",
    "# found[\"o\"]=0\n",
    "# found[\"u\"]=0\n",
    "\n",
    "# 方法二\n",
    "# for i in vowels:        # 可优化  fromkeys\n",
    "#     found[i] = 0\n",
    "# 优化后（fromkeys 实现初始化值）\n",
    "found = found.fromkeys(vowels,0)\n",
    "\n",
    "\n",
    "for i in word:\n",
    "    if i in vowels:\n",
    "        found[i] +=1\n",
    "print(found)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "052a13e0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'a': 0, 'e': 1, 'i': 0, 'o': 1, 'u': 0}\n"
     ]
    }
   ],
   "source": [
    "print(found)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dcc737d0",
   "metadata": {},
   "source": [
    "> 1.  字典的高级用法 fromkeys()\n",
    ">> 1. 给定序列的数据作为key\n",
    ">> 2. 把序列<font style=\"color:red\">**所有**</font>内容进行初始化，作为新的字典内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "3dbede02",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function fromkeys:\n",
      "\n",
      "fromkeys(iterable, value=None, /) method of builtins.type instance\n",
      "    Create a new dictionary with keys from iterable and values set to value.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(found.fromkeys)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "aae0ed2e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Alex': 0, 'Bob': 0, 'Mary': 0, 'Jane': 0}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_list = ['Alex','Bob','Mary','Jane']  # iterable\n",
    "name_age_dict = {}\n",
    "name_age_dict.fromkeys(name_list,0)\n",
    "# 把一个序列作为一个字典的keys， 然后初始化其值（默认值为：None），可以给定一个值"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5cc9afb8",
   "metadata": {},
   "source": [
    "## 2. 字典的实践（二）\n",
    "* 课本p121\n",
    "> 1. 利用字典统计出现的关键字的词频\n",
    "> 2. 指定内容初始化\n",
    "\n",
    "```\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provide a word to search for vowels:\")\n",
    "found = {}\n",
    "\n",
    "for letter in word:\n",
    "    if letter in vowels:\n",
    "        found.setdefault(letter,0)  #如果是元音字母，就在字典found中初始化这个元音字母，值为0\n",
    "        found[letter] +=1\n",
    "for k,v in sorted(found.items()):\n",
    "    print(k,v)\n",
    "\n",
    "\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3074da72",
   "metadata": {},
   "source": [
    "> 2.  字典的高级用法 setdefault()\n",
    ">>1. 如果字典中还没有该内容（item），新增该item作为字典的key，默认值default = None,可以指定值的内容（即初始化值的内容）\n",
    ">>2. 如果该内容（item）已经是字典的key，则不操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "bbad3c3d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function setdefault:\n",
      "\n",
      "setdefault(key, default=None, /) method of builtins.dict instance\n",
      "    Insert key with a value of default if key is not in the dictionary.\n",
      "    \n",
      "    Return the value for key if key is in the dictionary, else default.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(name_age_dict.setdefault)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "80376106",
   "metadata": {},
   "outputs": [],
   "source": [
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]      \n",
    "# word = input(\"请输入一段文本，将统计元音字母出现的次数:\")\n",
    "found = {\n",
    "    'a':2\n",
    "}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "9a854ccc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': 2, 'e': 0}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "found = {'a':2}\n",
    "found.setdefault('e',0) # e不存在found中\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "92017da6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "found.setdefault('a',5) # a 已经存在在字典中，不做任何操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "cf874311",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Provide a word to search for vowels:hello xiaoming\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'e': 1, 'o': 2, 'i': 2, 'a': 1}"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## 课本实践（二）优化\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provide a word to search for vowels:\")\n",
    "found = {}\n",
    "\n",
    "for letter in word:\n",
    "    if letter in vowels:\n",
    "        found.setdefault(letter,0)  # 如果是元音字母，就在字典found中初始化这个元音字母，值为0\n",
    "        found[letter] +=1\n",
    "# for k,v in sorted(found.items()):\n",
    "#     print(k,v)\n",
    "found"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a86b4dfc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 步骤\n",
    "# h 不在\n",
    "# e  found={'e':0}\n",
    "# 因为有出现 所以 found={'e':1}\n",
    "# l 不在\n",
    "# l 不在\n",
    "# o found={'e':1,'o':1}\n",
    "# \"空格\" 不在\n",
    "# x 不在\n",
    "# i found={'e':1,'o':1,'i':1}\n",
    "# a found={'e':1,'o':1,'i':1,'a':1}\n",
    "# o found={'e':1,'o':2,'i':1,'a':1}\n",
    "# m 不在\n",
    "# i found={'e':1,'o':2,'i':2,'a':1}\n",
    "# n 不在\n",
    "# g 不在"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "262d2800",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function pop:\n",
      "\n",
      "pop(...) method of builtins.dict instance\n",
      "    D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n",
      "    If key is not found, d is returned if given, otherwise KeyError is raised\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 例子\n",
    "help(found.pop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "5cdc7e90",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function keys:\n",
      "\n",
      "keys(...) method of builtins.dict instance\n",
      "    D.keys() -> a set-like object providing a view on D's keys\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(found.keys)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "87667c81",
   "metadata": {},
   "source": [
    "### 课后实践：\n",
    "\n",
    "|序号|字典的方法|用法|使用结果|注意事项|\n",
    "|---|-----|-----|-----|-----|\n",
    "|1|字典的删除pop()|D.pop()k,[.d]|remove specified key and return the corresponding value|KeyError出现情况：key 找不到|\n",
    "|2|字典查询所有关键字keys()| D.keys()|a set-like object providing a view on D's keys|keys的结果是什么类型|"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82f8c6ab",
   "metadata": {},
   "source": [
    "## 3. 字典的实践（三）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "7a049297",
   "metadata": {},
   "outputs": [],
   "source": [
    "people = {}\n",
    "people['Ford'] = {\"Name\":'Ford Prefect',\n",
    "                  \"Gender\":'Male',\n",
    "                  \"Occupation\":'Researcher',\n",
    "                  \"Home Planet\":'Betelgeuse Seven'}\n",
    "people['Arthur'] = {\"Name\":'Arthur Dent',\n",
    "                  \"Gender\":'Male',\n",
    "                  \"Occupation\":'Sandwich-Maker',\n",
    "                  \"Home Planet\":'Earth'}\n",
    "people['Tricia'] = {\"Name\":'Tricia McMillan',\n",
    "                    \"Gender\":'Female',\n",
    "                    \"Occupation\":'Mathematician',\n",
    "                    \"Home Planet\":'Earth'}\n",
    "people['Marvin'] = {\"Name\":'Marvin',\n",
    "                    \"Gender\":'Unknown',\n",
    "                    \"Occupation\":'Paranoid Android',\n",
    "                    \"Home Planet\":'Unknown'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "15d1e506",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Ford': {'Name': 'Ford Prefect',\n",
       "  'Gender': 'Male',\n",
       "  'Occupation': 'Researcher',\n",
       "  'Home Planet': 'Betelgeuse Seven'},\n",
       " 'Arthur': {'Name': 'Arthur Dent',\n",
       "  'Gender': 'Male',\n",
       "  'Occupation': 'Sandwich-Maker',\n",
       "  'Home Planet': 'Earth'},\n",
       " 'Tricia': {'Name': 'Tricia McMillan',\n",
       "  'Gender': 'Female',\n",
       "  'Occupation': 'Mathematician',\n",
       "  'Home Planet': 'Earth'},\n",
       " 'Marvin': {'Name': 'Marvin',\n",
       "  'Gender': 'Unknown',\n",
       "  'Occupation': 'Paranoid Android',\n",
       "  'Home Planet': 'Unknown'}}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "people"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "7f1705b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 请找出 Tricia 的名字全称\n",
    "Tricia_name = people['Tricia']['Name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "746f2f5a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Tricia McMillan'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Tricia_name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "52c05960",
   "metadata": {},
   "outputs": [],
   "source": [
    "Marvin_position = people['Marvin']['Home Planet']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "6a8deb88",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Unknown'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Marvin_position"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "8d96f336",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['Ford', 'Arthur', 'Tricia', 'Marvin'])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查询字典中所有的key\n",
    "people.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "919fb965",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_values([{'Name': 'Ford Prefect', 'Gender': 'Male', 'Occupation': 'Researcher', 'Home Planet': 'Betelgeuse Seven'}, {'Name': 'Arthur Dent', 'Gender': 'Male', 'Occupation': 'Sandwich-Maker', 'Home Planet': 'Earth'}, {'Name': 'Tricia McMillan', 'Gender': 'Female', 'Occupation': 'Mathematician', 'Home Planet': 'Earth'}, {'Name': 'Marvin', 'Gender': 'Unknown', 'Occupation': 'Paranoid Android', 'Home Planet': 'Unknown'}])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查询字典中所有的values\n",
    "people.values()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2deb07c0",
   "metadata": {},
   "source": [
    "### 讲解week08作业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "3571e604",
   "metadata": {},
   "outputs": [],
   "source": [
    "广州南方学院 = {'status': '1',\n",
    " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
    "    'location': '113.678,23.6284',\n",
    "    'direction': '北',\n",
    "    'name': '博学路',\n",
    "    'distance': '7.63232'},\n",
    "   {'id': '020F49F0050462229',\n",
    "    'location': '113.679,23.6245',\n",
    "    'direction': '北',\n",
    "    'name': '老虎形街',\n",
    "    'distance': '445.159'},\n",
    "   {'id': '020F49F0050462451',\n",
    "    'location': '113.677,23.6347',\n",
    "    'direction': '南',\n",
    "    'name': '中山路',\n",
    "    'distance': '708.299'}],\n",
    "  'roadinters': [{'second_name': '中山路',\n",
    "    'first_id': '020F49F0050461206',\n",
    "    'second_id': '020F49F0050462451',\n",
    "    'location': '113.676794,23.634661',\n",
    "    'distance': '708.299',\n",
    "    'first_name': '博学路',\n",
    "    'direction': '南'}],\n",
    "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
    "  'addressComponent': {'city': '广州市',\n",
    "   'province': '广东省',\n",
    "   'adcode': '440117',\n",
    "   'district': '从化区',\n",
    "   'towncode': '440117100000',\n",
    "   'streetNumber': {'number': '24号',\n",
    "    'location': '113.677267,23.629149',\n",
    "    'direction': '西北',\n",
    "    'distance': '129.943',\n",
    "    'street': '博学路'},\n",
    "   'country': '中国',\n",
    "   'township': '温泉镇',\n",
    "   'businessAreas': [[]],\n",
    "   'building': {'name': [], 'type': []},\n",
    "   'neighborhood': {'name': [], 'type': []},\n",
    "   'citycode': '020'},\n",
    "  'aois': [],\n",
    "  'pois': [{'id': 'B0FFG4TAF2',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
    "    'poiweight': '0.237309',\n",
    "    'name': '广州南方公寓',\n",
    "    'location': '113.678983,23.627778',\n",
    "    'distance': '102.617',\n",
    "    'tel': '13622768437',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0H6FA18J5',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院南侧)',\n",
    "    'poiweight': '0.223065',\n",
    "    'name': '保利半山花园',\n",
    "    'location': '113.679358,23.627672',\n",
    "    'distance': '139.054',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅区'},\n",
    "   {'id': 'B00140TWHT',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '笃行路2',\n",
    "    'poiweight': '0.157653',\n",
    "    'name': '教工住宅1号',\n",
    "    'location': '113.678490,23.630432',\n",
    "    'distance': '222.658',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0FFHRJDM9',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '中大南方学院南门1号',\n",
    "    'poiweight': '0.256152',\n",
    "    'name': '中南公寓',\n",
    "    'location': '113.680349,23.627573',\n",
    "    'distance': '231.723',\n",
    "    'tel': '13711245345',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0HGD588HJ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼4号',\n",
    "    'location': '113.677460,23.630490',\n",
    "    'distance': '242.901',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFHZH0IK',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路广州南方学院综合楼内',\n",
    "    'poiweight': '0.17934',\n",
    "    'name': '地下铁',\n",
    "    'location': '113.677941,23.629029',\n",
    "    'distance': '74.1376',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
    "   {'id': 'B0HGDU76L2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院2号实验楼',\n",
    "    'location': '113.678211,23.630956',\n",
    "    'distance': '280.003',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP838K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路25',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼3号(外国语学院)',\n",
    "    'location': '113.677247,23.630947',\n",
    "    'distance': '298.093',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU8NLD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院1号实验楼',\n",
    "    'location': '113.678215,23.631370',\n",
    "    'distance': '326.007',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD58UTU',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院2号教学楼',\n",
    "    'location': '113.677060,23.631346',\n",
    "    'distance': '346.352',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B00140MR9A',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号',\n",
    "    'poiweight': '0.450402',\n",
    "    'name': '广州南方学院',\n",
    "    'location': '113.679262,23.632583',\n",
    "    'distance': '471.564',\n",
    "    'tel': '020-87828988;020-61787331',\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU92JD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': [],\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼1号',\n",
    "    'location': '113.677077,23.631783',\n",
    "    'distance': '391.548',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD592BJ',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道886号广州南方学院内',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院综合楼',\n",
    "    'location': '113.680117,23.631544',\n",
    "    'distance': '392.731',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP81F0',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路19号附近',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼1号(文学与传媒学院)',\n",
    "    'location': '113.676866,23.631736',\n",
    "    'distance': '393.93',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFLBEOND',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.190963',\n",
    "    'name': '聚贤楼10号',\n",
    "    'location': '113.681253,23.631036',\n",
    "    'distance': '418.51',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0FFH6K3U9',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
    "    'poiweight': '0.254885',\n",
    "    'name': '广州中大南方招待所',\n",
    "    'location': '113.676330,23.631332',\n",
    "    'distance': '378.102',\n",
    "    'tel': '020-61787222',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGD58NF8',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院达人书院',\n",
    "    'location': '113.679041,23.632392',\n",
    "    'distance': '446.366',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFKUVYWV',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '保利桃花源',\n",
    "    'poiweight': '0.273168',\n",
    "    'name': '广州和风庭阿七度假别墅',\n",
    "    'location': '113.681736,23.630569',\n",
    "    'distance': '424.35',\n",
    "    'tel': '18681565305',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGDU99RM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内',\n",
    "    'poiweight': '0.257947',\n",
    "    'name': '广州南方学院图书馆',\n",
    "    'location': '113.679177,23.632762',\n",
    "    'distance': '489.331',\n",
    "    'tel': '020-61787368;020-61787371',\n",
    "    'type': '科教文化服务;图书馆;图书馆'},\n",
    "   {'id': 'B0HGDU92JC',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院4号实验楼',\n",
    "    'location': '113.679963,23.632652',\n",
    "    'distance': '498.883',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFL7C054',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
    "    'poiweight': '0.317505',\n",
    "    'name': '广州U优森特酒店',\n",
    "    'location': '113.679226,23.632528',\n",
    "    'distance': '464.819',\n",
    "    'tel': '15813395296',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0FFG8CSEK',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.185371',\n",
    "    'name': 'L5员工宿舍',\n",
    "    'location': '113.682583,23.631487',\n",
    "    'distance': '554.129',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0HGD58FR2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼9号',\n",
    "    'location': '113.679747,23.633032',\n",
    "    'distance': '532.163',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HG5Z9JNK',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221553',\n",
    "    'name': '广州南方学院教学楼7号',\n",
    "    'location': '113.678600,23.633330',\n",
    "    'distance': '544.868',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD599JM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院第11教学楼',\n",
    "    'location': '113.680037,23.633173',\n",
    "    'distance': '556.036',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0GUJYPEG2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
    "    'poiweight': '0.216026',\n",
    "    'name': '怒烤烤串(从化店)',\n",
    "    'location': '113.677160,23.632910',\n",
    "    'distance': '510.112',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
    "   {'id': 'B0HGDU6Z41',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼6号',\n",
    "    'location': '113.678424,23.633710',\n",
    "    'distance': '586.331',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD580NZ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路7号附近',\n",
    "    'poiweight': '0.285712',\n",
    "    'name': '广州南方学院惟贤门',\n",
    "    'location': '113.678437,23.633721',\n",
    "    'distance': '587.601',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU7T1K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院教学楼10号',\n",
    "    'location': '113.680125,23.633492',\n",
    "    'distance': '592.504',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0HGDU76L1',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '中山路与博学路交叉口东南150米',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼5号',\n",
    "    'location': '113.678046,23.633982',\n",
    "    'distance': '616.848',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'}]},\n",
    " 'info': 'OK',\n",
    " 'infocode': '10000'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "56f2eaa6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
       "    'location': '113.678,23.6284',\n",
       "    'direction': '北',\n",
       "    'name': '博学路',\n",
       "    'distance': '7.63232'},\n",
       "   {'id': '020F49F0050462229',\n",
       "    'location': '113.679,23.6245',\n",
       "    'direction': '北',\n",
       "    'name': '老虎形街',\n",
       "    'distance': '445.159'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '南',\n",
       "    'name': '中山路',\n",
       "    'distance': '708.299'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '708.299',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117100000',\n",
       "   'streetNumber': {'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [],\n",
       "  'pois': [{'id': 'B0FFG4TAF2',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "    'poiweight': '0.237309',\n",
       "    'name': '广州南方公寓',\n",
       "    'location': '113.678983,23.627778',\n",
       "    'distance': '102.617',\n",
       "    'tel': '13622768437',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0H6FA18J5',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院南侧)',\n",
       "    'poiweight': '0.223065',\n",
       "    'name': '保利半山花园',\n",
       "    'location': '113.679358,23.627672',\n",
       "    'distance': '139.054',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅区'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '222.658',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFHRJDM9',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '中大南方学院南门1号',\n",
       "    'poiweight': '0.256152',\n",
       "    'name': '中南公寓',\n",
       "    'location': '113.680349,23.627573',\n",
       "    'distance': '231.723',\n",
       "    'tel': '13711245345',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0HGD588HJ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '242.901',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFHZH0IK',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路广州南方学院综合楼内',\n",
       "    'poiweight': '0.17934',\n",
       "    'name': '地下铁',\n",
       "    'location': '113.677941,23.629029',\n",
       "    'distance': '74.1376',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
       "   {'id': 'B0HGDU76L2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '280.003',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '298.093',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU8NLD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '326.007',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD58UTU',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院2号教学楼',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '346.352',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00140MR9A',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '广州南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '471.564',\n",
       "    'tel': '020-87828988;020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU92JD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '391.548',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD592BJ',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号广州南方学院内',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '392.731',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '393.93',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '418.51',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '378.102',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'distance': '446.366',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKUVYWV',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '保利桃花源',\n",
       "    'poiweight': '0.273168',\n",
       "    'name': '广州和风庭阿七度假别墅',\n",
       "    'location': '113.681736,23.630569',\n",
       "    'distance': '424.35',\n",
       "    'tel': '18681565305',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '489.331',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0HGDU92JC',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '498.883',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'distance': '464.819',\n",
       "    'tel': '15813395296',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '554.129',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0HGD58FR2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼9号',\n",
       "    'location': '113.679747,23.633032',\n",
       "    'distance': '532.163',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HG5Z9JNK',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221553',\n",
       "    'name': '广州南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '544.868',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD599JM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '556.036',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "    'poiweight': '0.216026',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'distance': '510.112',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       "   {'id': 'B0HGDU6Z41',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '586.331',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD580NZ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.285712',\n",
       "    'name': '广州南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '587.601',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU7T1K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '592.504',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0HGDU76L1',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南150米',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼5号',\n",
       "    'location': '113.678046,23.633982',\n",
       "    'distance': '616.848',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院\n",
    "# 是字典 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "b0c315c8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['status', 'regeocode', 'info', 'infocode'])"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "6d649be1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 字典的查询的一般方法： 1. 先判断 key 是否存在   2. 用 dict_name[key] 进行查询\n",
    "广州南方学院['status']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9340c768",
   "metadata": {},
   "source": [
    "> 广州南方学院[ 'regeocode'] 是核心数据\n",
    ">> 1. 查看 广州南方学院[ 'regeocode'].keys()\n",
    ">> 2. 依次查询key所对应的value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "bb412ad1",
   "metadata": {},
   "outputs": [],
   "source": [
    "广州南方学院_regeocode = 广州南方学院[ 'regeocode']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "09cf2551",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'roads': [{'id': '020F49F0050461206',\n",
       "   'location': '113.678,23.6284',\n",
       "   'direction': '北',\n",
       "   'name': '博学路',\n",
       "   'distance': '7.63232'},\n",
       "  {'id': '020F49F0050462229',\n",
       "   'location': '113.679,23.6245',\n",
       "   'direction': '北',\n",
       "   'name': '老虎形街',\n",
       "   'distance': '445.159'},\n",
       "  {'id': '020F49F0050462451',\n",
       "   'location': '113.677,23.6347',\n",
       "   'direction': '南',\n",
       "   'name': '中山路',\n",
       "   'distance': '708.299'}],\n",
       " 'roadinters': [{'second_name': '中山路',\n",
       "   'first_id': '020F49F0050461206',\n",
       "   'second_id': '020F49F0050462451',\n",
       "   'location': '113.676794,23.634661',\n",
       "   'distance': '708.299',\n",
       "   'first_name': '博学路',\n",
       "   'direction': '南'}],\n",
       " 'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
       " 'addressComponent': {'city': '广州市',\n",
       "  'province': '广东省',\n",
       "  'adcode': '440117',\n",
       "  'district': '从化区',\n",
       "  'towncode': '440117100000',\n",
       "  'streetNumber': {'number': '24号',\n",
       "   'location': '113.677267,23.629149',\n",
       "   'direction': '西北',\n",
       "   'distance': '129.943',\n",
       "   'street': '博学路'},\n",
       "  'country': '中国',\n",
       "  'township': '温泉镇',\n",
       "  'businessAreas': [[]],\n",
       "  'building': {'name': [], 'type': []},\n",
       "  'neighborhood': {'name': [], 'type': []},\n",
       "  'citycode': '020'},\n",
       " 'aois': [],\n",
       " 'pois': [{'id': 'B0FFG4TAF2',\n",
       "   'direction': '东南',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "   'poiweight': '0.237309',\n",
       "   'name': '广州南方公寓',\n",
       "   'location': '113.678983,23.627778',\n",
       "   'distance': '102.617',\n",
       "   'tel': '13622768437',\n",
       "   'type': '商务住宅;住宅区;住宅小区'},\n",
       "  {'id': 'B0H6FA18J5',\n",
       "   'direction': '东南',\n",
       "   'businessarea': [],\n",
       "   'address': '从莞深高速(广州南方学院南侧)',\n",
       "   'poiweight': '0.223065',\n",
       "   'name': '保利半山花园',\n",
       "   'location': '113.679358,23.627672',\n",
       "   'distance': '139.054',\n",
       "   'tel': [],\n",
       "   'type': '商务住宅;住宅区;住宅区'},\n",
       "  {'id': 'B00140TWHT',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '笃行路2',\n",
       "   'poiweight': '0.157653',\n",
       "   'name': '教工住宅1号',\n",
       "   'location': '113.678490,23.630432',\n",
       "   'distance': '222.658',\n",
       "   'tel': [],\n",
       "   'type': '商务住宅;住宅区;住宅小区'},\n",
       "  {'id': 'B0FFHRJDM9',\n",
       "   'direction': '东南',\n",
       "   'businessarea': [],\n",
       "   'address': '中大南方学院南门1号',\n",
       "   'poiweight': '0.256152',\n",
       "   'name': '中南公寓',\n",
       "   'location': '113.680349,23.627573',\n",
       "   'distance': '231.723',\n",
       "   'tel': '13711245345',\n",
       "   'type': '商务住宅;住宅区;住宅小区'},\n",
       "  {'id': 'B0HGD588HJ',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院教学楼4号',\n",
       "   'location': '113.677460,23.630490',\n",
       "   'distance': '242.901',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0FFHZH0IK',\n",
       "   'direction': '西北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路广州南方学院综合楼内',\n",
       "   'poiweight': '0.17934',\n",
       "   'name': '地下铁',\n",
       "   'location': '113.677941,23.629029',\n",
       "   'distance': '74.1376',\n",
       "   'tel': [],\n",
       "   'type': '餐饮服务;冷饮店;冷饮店'},\n",
       "  {'id': 'B0HGDU76L2',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院2号实验楼',\n",
       "   'location': '113.678211,23.630956',\n",
       "   'distance': '280.003',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0FFKP838K',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路25',\n",
       "   'poiweight': '0.191742',\n",
       "   'name': '教学楼3号(外国语学院)',\n",
       "   'location': '113.677247,23.630947',\n",
       "   'distance': '298.093',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;高等院校'},\n",
       "  {'id': 'B0HGDU8NLD',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路附近',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院1号实验楼',\n",
       "   'location': '113.678215,23.631370',\n",
       "   'distance': '326.007',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0HGD58UTU',\n",
       "   'direction': '西北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路',\n",
       "   'poiweight': '0.191229',\n",
       "   'name': '广州南方学院2号教学楼',\n",
       "   'location': '113.677060,23.631346',\n",
       "   'distance': '346.352',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B00140MR9A',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道882号',\n",
       "   'poiweight': '0.450402',\n",
       "   'name': '广州南方学院',\n",
       "   'location': '113.679262,23.632583',\n",
       "   'distance': '471.564',\n",
       "   'tel': '020-87828988;020-61787331',\n",
       "   'type': '科教文化服务;学校;高等院校'},\n",
       "  {'id': 'B0HGDU92JD',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': [],\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院教学楼1号',\n",
       "   'location': '113.677077,23.631783',\n",
       "   'distance': '391.548',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0HGD592BJ',\n",
       "   'direction': '东北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道886号广州南方学院内',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院综合楼',\n",
       "   'location': '113.680117,23.631544',\n",
       "   'distance': '392.731',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0FFKP81F0',\n",
       "   'direction': '西北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路19号附近',\n",
       "   'poiweight': '0.191742',\n",
       "   'name': '教学楼1号(文学与传媒学院)',\n",
       "   'location': '113.676866,23.631736',\n",
       "   'distance': '393.93',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "  {'id': 'B0FFLBEOND',\n",
       "   'direction': '东北',\n",
       "   'businessarea': [],\n",
       "   'address': '从莞深高速(广州南方学院)',\n",
       "   'poiweight': '0.190963',\n",
       "   'name': '聚贤楼10号',\n",
       "   'location': '113.681253,23.631036',\n",
       "   'distance': '418.51',\n",
       "   'tel': [],\n",
       "   'type': '商务住宅;住宅区;宿舍'},\n",
       "  {'id': 'B0FFH6K3U9',\n",
       "   'direction': '西北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "   'poiweight': '0.254885',\n",
       "   'name': '广州中大南方招待所',\n",
       "   'location': '113.676330,23.631332',\n",
       "   'distance': '378.102',\n",
       "   'tel': '020-61787222',\n",
       "   'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "  {'id': 'B0HGD58NF8',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "   'poiweight': '0.191229',\n",
       "   'name': '广州南方学院达人书院',\n",
       "   'location': '113.679041,23.632392',\n",
       "   'distance': '446.366',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "  {'id': 'B0FFKUVYWV',\n",
       "   'direction': '东北',\n",
       "   'businessarea': [],\n",
       "   'address': '保利桃花源',\n",
       "   'poiweight': '0.273168',\n",
       "   'name': '广州和风庭阿七度假别墅',\n",
       "   'location': '113.681736,23.630569',\n",
       "   'distance': '424.35',\n",
       "   'tel': '18681565305',\n",
       "   'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "  {'id': 'B0HGDU99RM',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道882号广州南方学院内',\n",
       "   'poiweight': '0.257947',\n",
       "   'name': '广州南方学院图书馆',\n",
       "   'location': '113.679177,23.632762',\n",
       "   'distance': '489.331',\n",
       "   'tel': '020-61787368;020-61787371',\n",
       "   'type': '科教文化服务;图书馆;图书馆'},\n",
       "  {'id': 'B0HGDU92JC',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路附近',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院4号实验楼',\n",
       "   'location': '113.679963,23.632652',\n",
       "   'distance': '498.883',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0FFL7C054',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "   'poiweight': '0.317505',\n",
       "   'name': '广州U优森特酒店',\n",
       "   'location': '113.679226,23.632528',\n",
       "   'distance': '464.819',\n",
       "   'tel': '15813395296',\n",
       "   'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "  {'id': 'B0FFG8CSEK',\n",
       "   'direction': '东北',\n",
       "   'businessarea': [],\n",
       "   'address': '从莞深高速(广州南方学院)',\n",
       "   'poiweight': '0.185371',\n",
       "   'name': 'L5员工宿舍',\n",
       "   'location': '113.682583,23.631487',\n",
       "   'distance': '554.129',\n",
       "   'tel': [],\n",
       "   'type': '商务住宅;住宅区;宿舍'},\n",
       "  {'id': 'B0HGD58FR2',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '广州南方学院',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院教学楼9号',\n",
       "   'location': '113.679747,23.633032',\n",
       "   'distance': '532.163',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0HG5Z9JNK',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路',\n",
       "   'poiweight': '0.221553',\n",
       "   'name': '广州南方学院教学楼7号',\n",
       "   'location': '113.678600,23.633330',\n",
       "   'distance': '544.868',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0HGD599JM',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道882号广州南方学院',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院第11教学楼',\n",
       "   'location': '113.680037,23.633173',\n",
       "   'distance': '556.036',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0GUJYPEG2',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "   'poiweight': '0.216026',\n",
       "   'name': '怒烤烤串(从化店)',\n",
       "   'location': '113.677160,23.632910',\n",
       "   'distance': '510.112',\n",
       "   'tel': [],\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       "  {'id': 'B0HGDU6Z41',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '温泉大道882',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院教学楼6号',\n",
       "   'location': '113.678424,23.633710',\n",
       "   'distance': '586.331',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'},\n",
       "  {'id': 'B0HGD580NZ',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '博学路7号附近',\n",
       "   'poiweight': '0.285712',\n",
       "   'name': '广州南方学院惟贤门',\n",
       "   'location': '113.678437,23.633721',\n",
       "   'distance': '587.601',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;高等院校'},\n",
       "  {'id': 'B0HGDU7T1K',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '从莞深高速(广州南方学院)',\n",
       "   'poiweight': '0.191229',\n",
       "   'name': '广州南方学院教学楼10号',\n",
       "   'location': '113.680125,23.633492',\n",
       "   'distance': '592.504',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "  {'id': 'B0HGDU76L1',\n",
       "   'direction': '北',\n",
       "   'businessarea': [],\n",
       "   'address': '中山路与博学路交叉口东南150米',\n",
       "   'poiweight': '0.221662',\n",
       "   'name': '广州南方学院教学楼5号',\n",
       "   'location': '113.678046,23.633982',\n",
       "   'distance': '616.848',\n",
       "   'tel': [],\n",
       "   'type': '科教文化服务;学校;学校'}]}"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院[ 'regeocode']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "07f83265",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['roads', 'roadinters', 'formatted_address', 'addressComponent', 'aois', 'pois'])"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "64a1bff8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': '020F49F0050461206',\n",
       "  'location': '113.678,23.6284',\n",
       "  'direction': '北',\n",
       "  'name': '博学路',\n",
       "  'distance': '7.63232'},\n",
       " {'id': '020F49F0050462229',\n",
       "  'location': '113.679,23.6245',\n",
       "  'direction': '北',\n",
       "  'name': '老虎形街',\n",
       "  'distance': '445.159'},\n",
       " {'id': '020F49F0050462451',\n",
       "  'location': '113.677,23.6347',\n",
       "  'direction': '南',\n",
       "  'name': '中山路',\n",
       "  'distance': '708.299'}]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode['roads']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "36caf86b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'second_name': '中山路',\n",
       "  'first_id': '020F49F0050461206',\n",
       "  'second_id': '020F49F0050462451',\n",
       "  'location': '113.676794,23.634661',\n",
       "  'distance': '708.299',\n",
       "  'first_name': '博学路',\n",
       "  'direction': '南'}]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode['roadinters']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "045ffdb0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广东省广州市从化区温泉镇博学路'"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode['formatted_address']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "b4f166f1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'city': '广州市',\n",
       " 'province': '广东省',\n",
       " 'adcode': '440117',\n",
       " 'district': '从化区',\n",
       " 'towncode': '440117100000',\n",
       " 'streetNumber': {'number': '24号',\n",
       "  'location': '113.677267,23.629149',\n",
       "  'direction': '西北',\n",
       "  'distance': '129.943',\n",
       "  'street': '博学路'},\n",
       " 'country': '中国',\n",
       " 'township': '温泉镇',\n",
       " 'businessAreas': [[]],\n",
       " 'building': {'name': [], 'type': []},\n",
       " 'neighborhood': {'name': [], 'type': []},\n",
       " 'citycode': '020'}"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode['addressComponent']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "750e5cf3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode['aois']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8f545e6d",
   "metadata": {},
   "source": [
    "> 广州南方学院_regeocode['pois'] 是目标数据\n",
    ">> 1. 处理列表，首先查看列表的一个数据样态  例如： 广州南方学院_regeocode['pois'][0]['address']\n",
    ">> 2. 查看列表的长度（有多少个同样的数据形态的数据）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "118a3fab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': 'B0FFG4TAF2',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "  'poiweight': '0.237309',\n",
       "  'name': '广州南方公寓',\n",
       "  'location': '113.678983,23.627778',\n",
       "  'distance': '102.617',\n",
       "  'tel': '13622768437',\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0H6FA18J5',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院南侧)',\n",
       "  'poiweight': '0.223065',\n",
       "  'name': '保利半山花园',\n",
       "  'location': '113.679358,23.627672',\n",
       "  'distance': '139.054',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;住宅区'},\n",
       " {'id': 'B00140TWHT',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '笃行路2',\n",
       "  'poiweight': '0.157653',\n",
       "  'name': '教工住宅1号',\n",
       "  'location': '113.678490,23.630432',\n",
       "  'distance': '222.658',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0FFHRJDM9',\n",
       "  'direction': '东南',\n",
       "  'businessarea': [],\n",
       "  'address': '中大南方学院南门1号',\n",
       "  'poiweight': '0.256152',\n",
       "  'name': '中南公寓',\n",
       "  'location': '113.680349,23.627573',\n",
       "  'distance': '231.723',\n",
       "  'tel': '13711245345',\n",
       "  'type': '商务住宅;住宅区;住宅小区'},\n",
       " {'id': 'B0HGD588HJ',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼4号',\n",
       "  'location': '113.677460,23.630490',\n",
       "  'distance': '242.901',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFHZH0IK',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路广州南方学院综合楼内',\n",
       "  'poiweight': '0.17934',\n",
       "  'name': '地下铁',\n",
       "  'location': '113.677941,23.629029',\n",
       "  'distance': '74.1376',\n",
       "  'tel': [],\n",
       "  'type': '餐饮服务;冷饮店;冷饮店'},\n",
       " {'id': 'B0HGDU76L2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院2号实验楼',\n",
       "  'location': '113.678211,23.630956',\n",
       "  'distance': '280.003',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFKP838K',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路25',\n",
       "  'poiweight': '0.191742',\n",
       "  'name': '教学楼3号(外国语学院)',\n",
       "  'location': '113.677247,23.630947',\n",
       "  'distance': '298.093',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU8NLD',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路附近',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院1号实验楼',\n",
       "  'location': '113.678215,23.631370',\n",
       "  'distance': '326.007',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD58UTU',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院2号教学楼',\n",
       "  'location': '113.677060,23.631346',\n",
       "  'distance': '346.352',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B00140MR9A',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号',\n",
       "  'poiweight': '0.450402',\n",
       "  'name': '广州南方学院',\n",
       "  'location': '113.679262,23.632583',\n",
       "  'distance': '471.564',\n",
       "  'tel': '020-87828988;020-61787331',\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU92JD',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': [],\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼1号',\n",
       "  'location': '113.677077,23.631783',\n",
       "  'distance': '391.548',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD592BJ',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道886号广州南方学院内',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院综合楼',\n",
       "  'location': '113.680117,23.631544',\n",
       "  'distance': '392.731',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFKP81F0',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路19号附近',\n",
       "  'poiweight': '0.191742',\n",
       "  'name': '教学楼1号(文学与传媒学院)',\n",
       "  'location': '113.676866,23.631736',\n",
       "  'distance': '393.93',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0FFLBEOND',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.190963',\n",
       "  'name': '聚贤楼10号',\n",
       "  'location': '113.681253,23.631036',\n",
       "  'distance': '418.51',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;宿舍'},\n",
       " {'id': 'B0FFH6K3U9',\n",
       "  'direction': '西北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "  'poiweight': '0.254885',\n",
       "  'name': '广州中大南方招待所',\n",
       "  'location': '113.676330,23.631332',\n",
       "  'distance': '378.102',\n",
       "  'tel': '020-61787222',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0HGD58NF8',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院达人书院',\n",
       "  'location': '113.679041,23.632392',\n",
       "  'distance': '446.366',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0FFKUVYWV',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '保利桃花源',\n",
       "  'poiweight': '0.273168',\n",
       "  'name': '广州和风庭阿七度假别墅',\n",
       "  'location': '113.681736,23.630569',\n",
       "  'distance': '424.35',\n",
       "  'tel': '18681565305',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0HGDU99RM',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院内',\n",
       "  'poiweight': '0.257947',\n",
       "  'name': '广州南方学院图书馆',\n",
       "  'location': '113.679177,23.632762',\n",
       "  'distance': '489.331',\n",
       "  'tel': '020-61787368;020-61787371',\n",
       "  'type': '科教文化服务;图书馆;图书馆'},\n",
       " {'id': 'B0HGDU92JC',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路附近',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院4号实验楼',\n",
       "  'location': '113.679963,23.632652',\n",
       "  'distance': '498.883',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0FFL7C054',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "  'poiweight': '0.317505',\n",
       "  'name': '广州U优森特酒店',\n",
       "  'location': '113.679226,23.632528',\n",
       "  'distance': '464.819',\n",
       "  'tel': '15813395296',\n",
       "  'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       " {'id': 'B0FFG8CSEK',\n",
       "  'direction': '东北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.185371',\n",
       "  'name': 'L5员工宿舍',\n",
       "  'location': '113.682583,23.631487',\n",
       "  'distance': '554.129',\n",
       "  'tel': [],\n",
       "  'type': '商务住宅;住宅区;宿舍'},\n",
       " {'id': 'B0HGD58FR2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '广州南方学院',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼9号',\n",
       "  'location': '113.679747,23.633032',\n",
       "  'distance': '532.163',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HG5Z9JNK',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路',\n",
       "  'poiweight': '0.221553',\n",
       "  'name': '广州南方学院教学楼7号',\n",
       "  'location': '113.678600,23.633330',\n",
       "  'distance': '544.868',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD599JM',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院第11教学楼',\n",
       "  'location': '113.680037,23.633173',\n",
       "  'distance': '556.036',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0GUJYPEG2',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "  'poiweight': '0.216026',\n",
       "  'name': '怒烤烤串(从化店)',\n",
       "  'location': '113.677160,23.632910',\n",
       "  'distance': '510.112',\n",
       "  'tel': [],\n",
       "  'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       " {'id': 'B0HGDU6Z41',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '温泉大道882',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼6号',\n",
       "  'location': '113.678424,23.633710',\n",
       "  'distance': '586.331',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'},\n",
       " {'id': 'B0HGD580NZ',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '博学路7号附近',\n",
       "  'poiweight': '0.285712',\n",
       "  'name': '广州南方学院惟贤门',\n",
       "  'location': '113.678437,23.633721',\n",
       "  'distance': '587.601',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;高等院校'},\n",
       " {'id': 'B0HGDU7T1K',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '从莞深高速(广州南方学院)',\n",
       "  'poiweight': '0.191229',\n",
       "  'name': '广州南方学院教学楼10号',\n",
       "  'location': '113.680125,23.633492',\n",
       "  'distance': '592.504',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       " {'id': 'B0HGDU76L1',\n",
       "  'direction': '北',\n",
       "  'businessarea': [],\n",
       "  'address': '中山路与博学路交叉口东南150米',\n",
       "  'poiweight': '0.221662',\n",
       "  'name': '广州南方学院教学楼5号',\n",
       "  'location': '113.678046,23.633982',\n",
       "  'distance': '616.848',\n",
       "  'tel': [],\n",
       "  'type': '科教文化服务;学校;学校'}]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_regeocode['pois']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "c01d7feb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'温泉镇乌土村松浪队5号(近博学路)'"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 取出 pois 中的任意一个 address\n",
    "广州南方学院_regeocode['pois'][0]['address']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "d133ab28",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(广州南方学院_regeocode['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "00ba3178",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践：\n",
    "# 取出教工住宅1号的信息\n",
    "for i in 广州南方学院_regeocode['pois']:\n",
    "    if i['name'] == \"教工住宅1号\":\n",
    "        教工住宅1号 = i"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "0cf40547",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': 'B00140TWHT',\n",
       " 'direction': '北',\n",
       " 'businessarea': [],\n",
       " 'address': '笃行路2',\n",
       " 'poiweight': '0.157653',\n",
       " 'name': '教工住宅1号',\n",
       " 'location': '113.678490,23.630432',\n",
       " 'distance': '222.658',\n",
       " 'tel': [],\n",
       " 'type': '商务住宅;住宅区;住宅小区'}"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "教工住宅1号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "9cf762f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'教工住宅1号'"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "教工住宅1号_name = 教工住宅1号['name']\n",
    "教工住宅1号_name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "34f19a6e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践2 （找出某种数据特征的数据）： 取出direction 为 北 的所有数据\n",
    "direction_北 = []\n",
    "for i in 广州南方学院_regeocode['pois']:\n",
    "    if i['direction'] == \"北\":\n",
    "        direction_北.append(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "a1fe440e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(direction_北)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "b1456a9a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践3 （找出某种数据特征的数据）： 取出direction 为 北 的所有建筑名称\n",
    "direction_北_name = []\n",
    "for i in 广州南方学院_regeocode['pois']:\n",
    "    if i['direction'] == \"北\":\n",
    "        direction_北_name.append(i['name'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "f6b384e6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['教工住宅1号',\n",
       " '广州南方学院教学楼4号',\n",
       " '广州南方学院2号实验楼',\n",
       " '教学楼3号(外国语学院)',\n",
       " '广州南方学院1号实验楼',\n",
       " '广州南方学院',\n",
       " '广州南方学院教学楼1号',\n",
       " '广州南方学院达人书院',\n",
       " '广州南方学院图书馆',\n",
       " '广州南方学院4号实验楼',\n",
       " '广州U优森特酒店',\n",
       " '广州南方学院教学楼9号',\n",
       " '广州南方学院教学楼7号',\n",
       " '广州南方学院第11教学楼',\n",
       " '怒烤烤串(从化店)',\n",
       " '广州南方学院教学楼6号',\n",
       " '广州南方学院惟贤门',\n",
       " '广州南方学院教学楼10号',\n",
       " '广州南方学院教学楼5号']"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "direction_北_name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "ffabf21b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['广州南方学院2号实验楼', '广州南方学院1号实验楼', '广州南方学院4号实验楼']"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 实践4 （找出某种数据特征的数据）： 取出direction 为 北 的所有实验楼朝北的\n",
    "direction_北_name_实验楼 = []\n",
    "for i in direction_北_name:\n",
    "    if '实验楼' in i:\n",
    "        direction_北_name_实验楼.append(i)\n",
    "\n",
    "direction_北_name_实验楼  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "085b9e0c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'OK'"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['info']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "71a213e2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'10000'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['infocode']"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
